import Vue from 'vue'
import Vuex from 'vuex'
import actions from './actions'
import getters from './getters'
import mutations from './mutations'
// 使用插件 (use)
Vue.use(Vuex)
const moduleA = {
  state: {
    bobby: 'bootball'
  }
}
const state = {
  // 存放的键值对就是将来要进行公共管理的状态
  name: 'helloVuex',
  counter: 10,
  info: {
    id: 15,
    name: 'tianchao',
    age: '30'
  }
}
// 创建一个变量存储创建的store实例
const store = new Vuex.Store({
  // Vuex中几个基本属性下面会详细讲解
  state,
  actions,
  mutations,
  getters,
  modules: {
    a: moduleA
  }
})
export default store
